Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Sample Searching using SearchKick (Part One) #846

Merged
merged 9 commits into from
Dec 13, 2024
Merged

Conversation

ericenns
Copy link
Member

@ericenns ericenns commented Nov 20, 2024

What does this PR do and why?

Describe in detail what your merge request does and why.

In preparation for searching samples via complex metadata criteria, this PR adds in Searchkick as a dependency which uses OpenSearch (An open source ElasticSearch alternative) to index our Samples including metadata which allows complex querying. This PR just updates the Sample model to include indexing and updates the existing Project and Group Samples table to use SearchKick to perform the existing searches.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Follow SearchKick/OpenSearch section in README.md to setup opensearch

Verify migration to index existing Samples

  1. On main branch reset the database with bin/rails db:reset
  2. Switch to this branch and run migrations with bin/rails db:migrate
  3. Launch the server, then navigate to a Group Samples and a Project Samples table and verify that they both load

Verify db/seeds.rb creates indexes for Samples

  1. Reset the data base with bin/rails db:reset
  2. Launch the server, then navigate to a Group Samples and a Project Samples table and verify that they both load

Verify that Samples table loads on an empty database after creating a new Project

  1. Drop the database and create new, but don't seed with bin/rails db:drop db:create db:migrate
  2. Launch the server
  3. Register a new User
  4. Create a new Project
  5. Navigate to Samples table, and verify that it loads
  6. Create a new Sample
  7. Navigate back to Samples table and verify the new Sample exists

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

@ericenns ericenns changed the title Feat: Advanced Sample Searching using SearchKick (Part One) Feat: Sample Searching using SearchKick (Part One) Nov 20, 2024
@ericenns ericenns force-pushed the searchkick branch 4 times, most recently from 82ce434 to 31e55b9 Compare November 27, 2024 20:29

This comment has been minimized.

@ericenns ericenns self-assigned this Nov 27, 2024

This comment has been minimized.

This comment has been minimized.

@ericenns ericenns force-pushed the searchkick branch 3 times, most recently from 9d191db to a161fb6 Compare December 11, 2024 22:46

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

…exing and update Samples table to use Searchkick

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@ericenns ericenns marked this pull request as ready for review December 12, 2024 16:50
@ericenns ericenns requested a review from joshsadam December 12, 2024 16:51

This comment has been minimized.

Copy link

Code Metrics Report

Coverage Test Execution Time
92.5% 9m46s

Code coverage of files in pull request scope (96.1%)

Files Coverage
app/components/samples/table_component.html.erb 98.5%
app/controllers/groups/samples_controller.rb 100.0%
app/controllers/projects/samples_controller.rb 100.0%
app/models/sample.rb 94.2%
app/models/sample/query.rb 81.2%
app/services/samples/destroy_service.rb 100.0%

Reported by octocov

Copy link
Collaborator

@ChrisHuynh333 ChrisHuynh333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@joshsadam joshsadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

@joshsadam joshsadam merged commit 9fc4e2e into main Dec 13, 2024
4 checks passed
@joshsadam joshsadam deleted the searchkick branch December 13, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants